package kr.saeildamil.androidstudy_second20;

import kr.saeildamil.androidstudy_second.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class FragmentMgn extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch20_fragmentmgn);

		Button btnIncrease = (Button) findViewById(R.id.ch20_counterfragment_increase);
		final TextView textCounter = (TextView) findViewById(R.id.ch20_counterfragment_increase);
		btnIncrease.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				int count = Integer.parseInt(textCounter.getText().toString());
				textCounter.setText(Integer.toBinaryString(count + 1));
			}
		});
	}
}
